<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <style type="text/css">
	BODY,TD {FONT-FAMILY: "宋体"; FONT-SIZE: 10pt;line-height: 15px} 
	</style>
    <title>show applydept</title>
    <script type="text/javascript">
    	function addFlowaudit(field) {
    		var result = field.attributes['result'].nodeValue;
    		var def = document.getElementById('result_def');
    		def.value = result;
    		var branch = document.getElementById('dictbranch');
    		if(branch.value == "Y"){
    			var remark = document.getElementById('remark');
    			var branchno = document.getElementById('branchno');
    			
    			var res = field.attributes['branchno'].nodeValue;
    			var remark_branch = document.getElementById('remark_' + res);
    			
    			remark.value = remark_branch.value;
    			branchno.value = res;
    		}
    		document.getElementById('addFlowaudithistory').submit();
    	}
    </script>
  </head>
  <body bgcolor="#ccddee" link="#000066" vlink="#0066FF" alink="#99FF00">
    <br>
		<h3>查看报领单</h3>
		<fieldset><legend>基本信息</legend>
		<table width="100%" border=1 align="center" cellpadding="0" cellspacing="0" bgcolor="#ccddee" ><tr>
			<td width="200">报领编号：${applydept.applyno}</td>
			<td >申请机构：${applydept.departmentByDeptcode.deptcaption}</td>
			<td >目的机构：${applydept.departmentByDepartmentDeptcode.deptcaption}</td>
		</tr>
		<tr>
			<td width="200">主卡类型:${applydept.cardmaintype.cardmaintypename}</td>
			<td >卡单位：${applydept.datadictByUnit.name}</td>
			<td >流程约定时限: ${applydept.limitday}</td>
		</tr>
		<tr>
			<td width="200">申请人: ${applydept.personnel.loginname}</td>
			<td >优先级别:${applydept.datadictByPri.name}</td>
			<td >备注:${applydept.remark}</td>
		</tr></table>
		</fieldset>
		<s:form method="post" namespace="/workflow" theme="simple" action="addFlowaudithistory" >
		<table width="100%" border="0">
		<tr>
			<td width="50">
				<input type="button" value="添加子项" onclick="location.href='goAddApplydeptdetail.action?applyno=${applydept.applyno}'">
			</td>
			<td width="50">
				<input type="button" value="查看报领单列表" onclick="location.href='findAllApplydept.action'">
			</td>
			<td width="50">
				<input type="button" value="查看审核记录" onclick="location.href='findAllFlowaudithistoryWithParam.action?flowflag=86&flowno=${applydept.applyno}'">
			</td>
			<c:if test="${applydept.datadictByBranch.name == 'N' && applydept.datadictByStatus.name != '作废' && applydept.datadictByStatus.name != '完成'}">
			<td width="50">
				<s:textfield name="flowaudithistory.remark" theme="simple" ></s:textfield>
			</td>
			<td width="50">
				<input type="button" value="通过" result="T" onclick="addFlowaudit(this)">
				<input type="button" value="拒绝" result="F" onclick="addFlowaudit(this)">
			</td>
			</c:if>
			<c:if test="${applydept.datadictByBranch.name != 'N' }">
				<input type="hidden" id="remark" name="flowaudithistory.remark" value="">
				<input type="hidden" id="branchno" name="branchno" value="">
			</c:if>
			<td >
				<input type="hidden" name="flowno" value="${applydept.applyno}">
			</td>
			<td >
				<input type="hidden" name="flowflag" value="86">
			</td>
			<td >
				<input type="hidden" id="dictbranch" name="dictbranch" value="${applydept.datadictByBranch.name}">
			</td>
			<td >
				<input type="hidden" name="result" value="F" id="result_def">
			</td>
		</tr>
		</table>
		</s:form>
		<fieldset><legend>子菜单</legend>
		<table width="100%" border=1 align="center" cellpadding="0" cellspacing="0" bgcolor="#ccddee" >
				<tr>
			        <td align="center">编号</td>
			        <td align="center">卡类型</td>
			        <td align="center">数量</td>
			        <td align="center">金额</td>
			        <td align="center">操作</td>
      			</tr>
      			<s:iterator value="pm.datas" status="rowstatus" var="applydeptdetail">
      				<tr <s:if test="#rowstatus.odd == true">bgcolor="white"</s:if>>
				        <td align="center">
				        	<s:property value="appdetailno"/>
				        </td>
				        <td align="center">
				        	<s:property value="#applydeptdetail.cardsubtype.cardsubtypename"/>
				        </td>
				        <td align="center">
				        	<s:property value="totalsum"/>
				        </td>
				        <td align="center">
				        	<s:property value="money"/>
				        </td>
			        	<td align="center">
			        		<c:if test="${applydept.datadictByBranch.name != 'N' }">
			        		<input type="text" id="remark_<s:property value="appdetailno"/>" name="remark_<s:property value="appdetailno"/>" >
			        		<input type="button" value="通过" result="T" resource=<s:property value="appdetailno"/> onclick="addFlowaudit(this)">
							<input type="button" value="拒绝" result="F" resource=<s:property value="appdetailno"/> onclick="addFlowaudit(this)">
							</c:if>
							<s:if test="#applydeptdetail.applydept.datadictByStatus.name == '作废' || #applydeptdetail.applydept.datadictByStatus.name == '保存'">
			        		<a href='delApplydeptdetail.action?applyno=${applydept.applyno}&appdetailno=<s:property value="appdetailno"/>'>删除</a>
			        		</s:if>
			        		<a href="getApplydeptdetailForUpdate.action?appdetailno=<s:property value="appdetailno"/>">修改</a>
			        	</td>
			        </tr>
				</s:iterator>
				<tr>
					<td colspan="8" align="center">
				<pg:pager url="${url}" items="${pm.total }" export="offset,currentPageNumber=pageNumber">
					<pg:first>
						<a href="${pageUrl }">首页</a>
					</pg:first>
					<pg:prev>
						<a href="${pageUrl }">前页</a>
					</pg:prev>
					<pg:pages>
						<c:choose>
							<c:when test="${currentPageNumber eq pageNumber}">
								<font color="red">${pageNumber }</font>
							</c:when>
							<c:otherwise>
								<a href="${pageUrl }">${pageNumber }</a>
							</c:otherwise>
						</c:choose>
					</pg:pages>
					<pg:next>
						<a href="${pageUrl }">后页</a>
					</pg:next>
					<pg:last>
						<a href="${pageUrl }">尾页</a>
					</pg:last>
				</pg:pager>
					</td>
				</tr>
      		</table>
		</fieldset>
		<br>
</body>
</html>
